from pydantic import BaseModel
from typing import List


class Book(BaseModel):
    id: int
    name: str


class BookStore(BaseModel):
    name: str
    address: str
    books: List[Book]


store = BookStore(name="新华书店",address="庆春路377号",books=[{"id":1001,"name":"鲁迅散文集"},{"id":1002,"name":"围城"}])
print(store)